package com.shsxt.controller;

import java.io.UnsupportedEncodingException;
import java.lang.reflect.InvocationTargetException;
import java.text.ParseException;
import java.util.Map;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alipay.api.AlipayApiException;
import com.shsxt.service.CouponService;


@Controller
@RequestMapping("coupon")
public class CouponController  {
	
	
	@Autowired
	private CouponService couponService;
	
	
   
    //活动
    @RequestMapping(value="activity")
   	public  @ResponseBody Map<String, Object> activity( ) {
    	Map<String, Object>  str= couponService.activity();
       	return str;
   	}	
    //活动点赞
    @RequestMapping(value="activityDianzan")
   	public  @ResponseBody Map<String, Object> activityDianzan( String id,String phoneNumber) {
    	Map<String, Object>  str= couponService.activityDianzan(id,phoneNumber);
       	return str;
   	}	
  //兑换 兑换码
    @RequestMapping(value="usecdkey")
   	public  @ResponseBody Map<String, Object> usecdkey(String cdkey ,String phoneNumber) {
    	Map<String, Object>  str= couponService.usecdkey(cdkey,phoneNumber);
       	return str;
   	}
  //修改 兑换码提交
    @RequestMapping(value="fixCdkey")
   	public  @ResponseBody Map<String, Object> fixCdkey(String cdkey ,String phoneNumber,String check) throws ParseException {
    	Map<String, Object>  str= couponService.fixCdkey(cdkey,phoneNumber,check);
       	return str;
   	}
   
		
		

	

	
	
	
}
